<template>
	<view class="queryRearchList">
		<commonNavBar title="企业详情"     ></commonNavBar>  
		<view class="h1" id="h1"> 
			{{companyData.companyName}} 
			<view class="float">
				{{companyData.typeCompany}}
			</view>
		</view>
		<view class="h2">
			<view class="h2-view">
				<image  class="h2-image" src="/static/img/xz.png" mode=""></image>
				统一社会信用代码:{{companyData.creditCode}}
			</view>
			<view class="h2-view">
				<image class="h2-image" src="/static/img/xz.png" mode=""></image>
				登记机关:{{companyData.registerName}}
			</view>
			<view class="h2-view">
				<image  class="h2-image" src="/static/img/xz.png" mode=""></image>
				法人代表人:{{companyData.legalName}}
			</view>
		</view>
		<view class="tab-container"  >
			<scroll-view class="tab-scroll" scroll-x :scroll-left="scrollLeft" scroll-with-animation>
				<view class="tab-items">
					<view v-for="(tab, index) in tabs" :key="index" :id="'item'+index"
						:class="['tab-item', currentTabIndex === index ? 'active' : '']" @tap="switchTab(index)">
						{{ tab.title }}
					</view>
				</view>
			</scroll-view>
			
			<scroll-view class="content-container" id="scrrent-page"  :scroll-y="true" :style="{height: bottomHeight+ 'px'}">
				<view  v-show="currentTabIndex === 0" class="content" >
					<view class="desc-item"><text class="desc-item-text">经营范围: {{companyData.businessScope}}</text></view>
					<view class="desc-item"><text class="desc-item-text">营业期限: {{companyData.termEnd }}</text> </view>
				</view>
				<view   v-show="currentTabIndex === 1" class="content">
					<view class="license-item-box" v-if="scLicenseData.license != '' && scLicenseData.license != null">
						<uni-section class="mb-10" titleFontSize="25rpx" title="生产许可证:" type="circle"></uni-section>
						<view class="license-item">
							<text class="license-item-left">许可证编号：</text>
							<text class="license-item-right">{{scLicenseData.license}}</text>
						</view>
						<view class="license-item">
							<text class="license-item-left">食品类别名称：</text>
							<text class="license-item-right">{{scLicenseData.splb}}</text>
						</view>
						<view class="license-item">
							<text class="license-item-left">发证机关名称：</text>
							<text class="license-item-right">{{scLicenseData.fzjg}}</text>
						</view>
						<view class="license-item">
							<text class="license-item-left">发证日期：</text>
							<text class="license-item-right">{{scLicenseData.fzrq}}</text>
						</view>
						<view class="license-item">
							<text class="license-item-left">有效期至：</text>
							<text class="license-item-right">{{scLicenseData.yxqz}}</text>
						</view>
						<view class="license-item">
							<text class="license-item-left">日常监管机构名称：</text>
							<text class="license-item-right">{{scLicenseData.deptName}}</text>
						</view>
						<view class="license-item">
							<text class="license-item-left">日常监管人员姓名：</text>
							<text class="license-item-right">{{scLicenseData.legalHead1Name}}</text>
						</view>
						<view class="license-item">
							<text class="license-item-left">生产地址：</text>
							<text class="license-item-right">{{scLicenseData.address}}</text>
						</view>
						<view class="license-item">
							<text class="license-item-left">所属区县：</text>
							<text class="license-item-right">{{scLicenseData.district}}</text>
						</view>
					</view>
					<view class="license-item-box"  v-if="licenseData.license != '' && licenseData.license != null">
						<uni-section class="mb-10" titleFontSize="25rpx" title="经营许可证:" type="circle"></uni-section>
						 <view class="license-item">
						 	<text class="license-item-left">许可证编号：</text>
						 	<text class="license-item-right">{{licenseData.license}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">经营项目名称：</text>
						 	<text class="license-item-right">{{licenseData.businessScope}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">发证机关名称：</text>
						 	<text class="license-item-right">{{licenseData.fzjg}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">发证日期：</text>
						 	<text class="license-item-right">{{licenseData.fzrq}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">有效期至：</text>
						 	<text class="license-item-right">{{licenseData.yxqz}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">日常监管机构名称：</text>
						 	<text class="license-item-right">{{licenseData.deptName}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">日常监管人员姓名：</text>
						 	<text class="license-item-right">{{licenseData.legalHead1Name}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">生产地址：</text>
						 	<text class="license-item-right">{{licenseData.address}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">主体业态名称：</text>
						 	<text class="license-item-right">{{licenseData.name}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">所属区县：</text>
						 	<text class="license-item-right">{{licenseData.ssqx}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">所属监管所：</text>
						 	<text class="license-item-right">{{licenseData.ssjgs}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">是否申请网络经营：</text>
						 	<text class="license-item-right">{{licenseData.isNetworkbusiness}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">是否申请建立中央厨房：</text>
						 	<text class="license-item-right">{{licenseData.isCentralkitchen}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">是否申请集体用餐配送：</text>
						 	<text class="license-item-right">{{licenseData.isMealdelivery}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">是否销售食盐：</text>
						 	<text class="license-item-right">{{licenseData.isSalt}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">是否销售农产品：</text>
						 	<text class="license-item-right">{{licenseData.isFarmproducts}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">在售农产品品类：</text>
						 	<text class="license-item-right">{{licenseData.isProducttype}}</text>
						 </view>
						 <view class="license-item">
						 	<text class="license-item-left">许可证状态：</text>
						 	<text class="license-item-right">{{licenseData.manageStatus}}</text>
						 </view> 
					</view>
				</view>
				<view   v-show="currentTabIndex === 2" class="content" >
					<!-- 处罚文书 --> 
				 	<z-paging ref="paging2"   :fixed="false" :style="{height: bottomHeight + 'px'}"  v-model="punishmentList"    @query="punishmentQuery"     :auto="false" >
						<view class="punishment-item" v-for="(list, index) in punishmentList" :key="index"  >
							<view class="punishment-item-view"><text class="punishment-item-title">决定文书号:{{ list.ggmc }}</text></view> 
							<view class="punishment-item-view"><text class="punishment-item-text">违法行为类型:{{ list.cfzl }}</text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">行政处罚内容:{{ list.cfnr }}</text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">决定机关名称:{{ list.cfjg }}</text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">处罚决定日期:{{ list.cfrq }}</text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">处罚依据:{{ list.cfyj }}</text></view>
						</view>
					</z-paging> 
				</view>
				<view   v-show="currentTabIndex === 3" class="content" >
					<!-- 列入异常经营名录信息 --> 
					<z-paging ref="paging3"   :fixed="false" :style="{height: bottomHeight+ 'px'}" v-model="abnormalList"   @query="abnormalQuery"  :auto="false"   >
						<view class="punishment-item" v-for="(list, index) in abnormalList" :key="index"  >
							<view class="punishment-item-view"><text class="punishment-item-title">做出决定机关:{{ list.makeDecisionOrg }}</text></view> 
							<view class="punishment-item-view"><text class="punishment-item-text">列入日期:{{ list.inclusionDate }}</text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">列入原因:{{ list.inclusionReason }}</text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">移出日期:{{ list.removeDate }}</text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">移出原因:{{ list.removeReason }}</text></view> 
						</view>
					</z-paging>
				</view>
				<view   v-show="currentTabIndex === 4" class="content" >
					<!-- 列入严重违法失信名单（黑名单）信息 --> 
					<z-paging ref="paging4" :fixed="false" :style="{height: bottomHeight+ 'px'}" v-model="promiseList"   @query="promiseQuery" :auto="false"   >
						<view class="punishment-item" v-for="(list, index) in promiseList" :key="index"  >
							<view class="punishment-item-view"><text class="punishment-item-title">做出决定机关:{{ list.makeDecisionOrg }}</text></view> 
							<view class="punishment-item-view"><text class="punishment-item-text">文号:{{ list.documentno }}</text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">列入日期:{{ list.inclusionDate }}</text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">列入原因:{{ list.inclusionReason }}</text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">移出日期:{{ list.removeDate }}</text></view> 
							<view class="punishment-item-view" ><text class="punishment-item-text">移出原因:{{ list.removeReason }}</text></view> 
						</view>
					</z-paging> 
				</view>
				<view    v-show="currentTabIndex === 5" class="content" >
					<!-- 日常检查信息 -->
					<uni-data-picker :localdata="dayCheckSelectTree" v-model="dayCheckValue" popup-title="请选择" @change="handleChange" ></uni-data-picker>
					<view class="punishment-item" style="margin-top: 15rpx;" v-for="(list, index) in dayCheckList" :key="index"  >
						<view class="punishment-item-view"><text class="punishment-item-title">监管单位:{{ list.deptName }}</text></view> 
						<view class="punishment-item-view"><text class="punishment-item-text">检查时间:{{ list.dailychkdate }}</text></view>
						<view class="punishment-item-view" ><text class="punishment-item-text">检查人员1:{{ list.dailychkpeople }}</text></view>
						<view class="punishment-item-view" ><text class="punishment-item-text">检查人员2:{{ list.dailychkpeople2 }}</text></view>
						<view class="punishment-item-view" ><text class="punishment-item-text" v-if="list.otherchkuser != null && list.otherchkuser != ''">检查人员3:{{ list.otherchkuser }}</text></view> 
						<view class="punishment-item-view" ><text class="punishment-item-text">生产经营主体:{{ list.companyName }}</text></view> 
						<view class="punishment-item-view" ><text class="punishment-item-text">生产经营地址:{{ list.address }}</text></view> 
						<view class="punishment-item-view" ><text class="punishment-item-text">负责人:{{ list.jguser }}</text></view> 
						<view class="punishment-item-view" ><text class="punishment-item-text">联系方式:{{ list.jgusercontact }}</text></view> 
						<view class="punishment-item-view" ><text class="punishment-item-text">检查内容:{{ list.checkInfo }}</text></view> 
						<view class="punishment-item-view" ><text class="punishment-item-text">类别:{{ list.processName }}</text></view> 
						<view class="punishment-item-view" ><text class="punishment-item-text">类别名称:{{ list.classSuperName }}</text></view> 
						<view class="punishment-item-view" ><text class="punishment-item-text">检查结果:{{ list.ame }}</text></view> 
						<view class="punishment-item-view" ><text class="punishment-item-text">门脸照片:{{ list.comanyPic }}</text></view>  
					</view>
				</view>
				<view    v-show="currentTabIndex === 6" class="content" >
					<!-- 执法文书信息 --> 
					<z-paging ref="paging6" :fixed="false" :style="{height: bottomHeight+ 'px'}" v-model="enforcementDocList"   @query="enforcementDocQuery"   :auto="false"   >
						<view class="punishment-item" v-for="(list, index) in enforcementDocList" :key="index"  >
							<view class="punishment-item-view"><text class="punishment-item-title">案号:{{ list.bianhao }}</text></view> 
							<view class="punishment-item-view"><text class="punishment-item-text">当事人:{{ list.dangshiren }}</text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">法院:{{ list.fayuan }}</text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">类型:{{ list.leixing }}</text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">程序:{{ list.chengxu }}</text></view> 
							<view class="punishment-item-view" ><text class="punishment-item-text">案由:{{ list.anyou }}</text></view> 
							<view class="punishment-item-view" ><text class="punishment-item-text">发布日期:{{ list.faburiqi }}</text></view> 
							<view class="punishment-item-view" ><text class="punishment-item-text">裁判日期:{{ list.caipanriqi }}</text></view> 
							<view class="punishment-item-view" ><text class="punishment-item-text">法律依据:{{ list.falvyiju }}</text></view> 
						</view>
					</z-paging> 
				</view>
				<view   v-show="currentTabIndex === 7" class="content" >
					<!-- 抽检不合格信息 --> 
					<z-paging ref="paging7" :fixed="false" :style="{height: bottomHeight+ 'px'}" v-model="spotCheckNoList"   @query="spotCheckNoQuery" :auto="false"   >
						<view class="punishment-item" v-for="(list, index) in spotCheckNoList" :key="index"  >
							<view class="punishment-item-view"><text class="punishment-item-title">任务来源:{{list.rwly}} </text></view>
							<view class="punishment-item-view"><text class="punishment-item-text">抽样单位名称: {{list.cydwmc}}  </text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">抽样场所: {{list.bcydwmc}}  </text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">样品名称:{{list.ypmc}}  </text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">食品大类: {{list.spdl}}  </text></view> 
							<view class="punishment-item-view" ><text class="punishment-item-text">食品亚类: {{list.spyl}}  </text></view> 
							<view class="punishment-item-view" ><text class="punishment-item-text">食品次亚类: {{list.spcyl}}  </text></view> 
							<view class="punishment-item-view" ><text class="punishment-item-text">食品细类: {{list.spxl}}  </text></view> 
							<view class="punishment-item-view" ><text class="punishment-item-text">抽样时间: {{list.cydw}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">被抽样单位省: {{list.bcydwshe}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">被抽样单位市: {{list.bcydwshi}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">被抽样单位县: {{list.bcydwx}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">被抽样单位地址: {{list.bcydwdz}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">抽样单位名称: {{list.cydwmc}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">检验机构名称: {{list.jyjgmc}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">样品规格: {{list.ypgf}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">生产/加工/购进/检疫日期: {{list.scjgjyrq}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">日期类型: {{list.rqlx}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">标识生产企业名称: {{list.bcscqymc}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">标识生产企业地址: {{list.bcscqydz}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">标识生产企业省份: {{list.bcscqysf}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">标识生产企业市: {{list.bcscqys}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">标识生产企业县: {{list.bcscqyx}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">抽样环节(生产流通餐饮): {{list.cjhj}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">任务来源(市/区): {{list.rwly}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">是否进口: {{list.sfjk}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">原产国: {{list.ycg}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">第一次递交到秘书处时间: {{list.dyctjmscrq}}  </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">结论: {{list.jl}}  </text></view>  
						</view>
					</z-paging> 
				</view>
				<view    v-show="currentTabIndex === 8" class="content" >
					<!-- 抽检合格信息 --> 
					<z-paging ref="paging8" :fixed="false" :style="{height: bottomHeight+ 'px'}" v-model="spotCheckList"   @query="spotCheckQuery" :auto="false"   >
						<view class="punishment-item" v-for="(list, index) in spotCheckList" :key="index"  >
							<view class="punishment-item-view"><text class="punishment-item-title">任务来源:{{list.rwly}} </text></view>
							<view class="punishment-item-view"><text class="punishment-item-text">抽样单位名称: {{list.cydwmc}} </text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">抽样场所: {{list.bcydwmc}} </text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">样品名称:{{list.ypmc}} </text></view>
							<view class="punishment-item-view" ><text class="punishment-item-text">食品大类: {{list.spdl}} </text></view> 
							<view class="punishment-item-view" ><text class="punishment-item-text">食品亚类: {{list.spyl}} </text></view> 
							<view class="punishment-item-view" ><text class="punishment-item-text">食品次亚类: {{list.spcyl}} </text></view> 
							<view class="punishment-item-view" ><text class="punishment-item-text">食品细类: {{list.spxl}} </text></view> 
							<view class="punishment-item-view" ><text class="punishment-item-text">抽样时间: {{list.cydw}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">被抽样单位省: {{list.bcydwshe}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">被抽样单位市: {{list.bcydwshi}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">被抽样单位县: {{list.bcydwx}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">被抽样单位地址: {{list.bcydwdz}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">抽样单位名称: {{list.cydwmc}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">检验机构名称: {{list.jyjgmc}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">样品规格: {{list.ypgf}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">生产/加工/购进/检疫日期: {{list.scjgjyrq}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">日期类型: {{list.rqlx}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">标识生产企业名称: {{list.bcscqymc}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">标识生产企业地址: {{list.bcscqydz}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">标识生产企业省份: {{list.bcscqysf}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">标识生产企业市: {{list.bcscqys}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">标识生产企业县: {{list.bcscqyx}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">抽样环节(生产流通餐饮): {{list.cjhj}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">是否进口: {{list.sfjk}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">原产国: {{list.ycg}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">第一次递交到秘书处时间: {{list.dyctjmscrq}} </text></view>  
							<view class="punishment-item-view" ><text class="punishment-item-text">结论: {{list.jl}} </text></view>  
						</view>
					</z-paging>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	import commonNavBar from '@/components/CommonNavBar.vue';
	export default {
		components: {
			commonNavBar,
		},
		data() {
			return {
				tabs: [{
						title: '基础信息',
						content: '选项1的内容'
					},
					{
						title: '许可信息',
						content: '选项2的内容'
					},
					{
						title: '行政处罚信息',
						content: '选项3的内容'
					},
					{
						title: '列入异常经营名录信息',
						content: '选项3的内容'
					},
					{
						title: '列入严重违法失信值名单(黑名单)信息',
						content: '选项3的内容'
					},
					{
						title: '日常检查信息',
						content: '选项3的内容'
					},
					{
						title: '执法文书信息',
						content: '选项3的内容'
					},
					{
						title: '抽检不合格信息',
						content: '选项3的内容'
					},
					{
						title: '抽检合格信息',
						content: '选项3的内容'
					},
				],
				dayCheckValue:'', 
				companyData:{}, 
				licenseData:{},  //经营许可
				scLicenseData:{},  // 生产许可
				spotCheckList: [], //抽检合格
				spotCheckNoList: [], //抽检不合格
				enforcementDocList: [], //执法文书
				promiseList: [], //异常名录
				abnormalList: [], //异常名录
				punishmentList: [], //行政处罚 
				dayCheckList: [], //日常检查
				year: [],
				dayCheckDataTreeList: {},
				dayCheckSelectTree: [],//日常检查左上角筛选
				bottomHeight: 0, //下面内容的高度
				topHeight: 0,  
				currentTabIndex: 0, // 当前选中的选项卡索引
				scrollLeft: 0 // 横向滚动距离
			}
		},
		onLoad(options) {
			const that = this; 
			 const eventChannel = this.getOpenerEventChannel();  
			  eventChannel.on('loadInitData', function(data) { 
				that.companyData = data
			  }) 
		},
		onReady() {
			const that = this;
			const query = uni.createSelectorQuery().in(that);
			query.select('#h1').boundingClientRect(data1 => {
				that.topHeight = data1.height;  
			}).exec();
			query.select('#scrrent-page').boundingClientRect(data => {
			   that.bottomHeight = uni.getSystemInfoSync().screenHeight -  data.top   - that.topHeight - 50 ;  
			}).exec();
		},
		methods: {
			switchTab(index) {
				this.currentTabIndex = index;
				if(index == 1 ){
					this.licenseQuery();//获取经营许可
					this.scLicenseQuery();//获取生产许可
				} else if(index == 2 ){
					//行政处罚信息 
					this.$refs.paging2.reload()
				}  else if(index == 3 ){
					//列入异常经营名录信息
					this.$refs.paging3.reload()
				}   else if(index == 4 ){
					//列入严重违法失信名单（黑名单）信息
					this.$refs.paging4.reload()
				}    else if(index == 5 ){
					//日常检查
					this.dayCheckQuery()
				}    else if(index == 6 ){
					//执法文书信息
					this.$refs.paging6.reload()
				}    else if(index == 7 ){
					//抽检不合格
					this.$refs.paging7.reload()
				}    else if(index == 8 ){
					//抽检合格
					this.$refs.paging8.reload()
				}  
				// 计算选项卡的滚动位置
				let left = 0;
				for (var i = 0; i < index; i++) {
					left = left  + this.tabs[i].title.length * 15;
				} 
				this.scrollLeft  = left;
			},
			licenseQuery(){
				// 获取经营许可信息/
				const that = this;
				uni.$api.getRobotLicenseList({
					current: 1,
					size: 10,
					creditCode: this.companyData.creditCode
				}).then(res => { 
					//console.log("经营许可",res)
				    let dataListJY = res.data.data.records
					if (dataListJY) {
						this.licenseData = dataListJY[0] || {}
					}
				},err =>{
					
				})
			},
			scLicenseQuery(){
				// 获取生产营许可信息/
				const that = this;
				uni.$api.getRobotScLicenseList({
					current: 1,
					size: 10,
					creditCode: this.companyData.creditCode
				}).then(res => {   
					//console.log("生产许可",res)
				    let dataListSC = res.data.data.records
					if (dataListSC) {
						this.scLicenseData = dataListSC[0] || {}
					}
				},err =>{
					
				})
			},
			punishmentQuery(pageNum,pageSize){
				//获取行政处罚列表数据
				const that = this; 
				uni.$api.getRobotPunishmentList({
					current: pageNum,
					size: pageSize,
					dsr: this.companyData.companyName
				}).then(res => {   
					//console.log("获取行政处罚列表数据",res)
					if(res.data.code != '0'){
						 that.$refs.paging2.complete(false);
						 return;
					} 
					that.$refs.paging2.completeByKey(res.data.data.records,that.currentTabIndex);
					
				},err =>{
					 that.$refs.paging2.complete(false);
				})
			},
			abnormalQuery(pageNum,pageSize){
				//获取异常名录列表数据
				const that = this;
				uni.$api.getRobotAbnormalList({
					current: pageNum,
					size: pageSize,
					unifySocietyCc: this.companyData.creditCode
				}).then(res => {  
					//console.log("获取异常名录列表数据",res)
					that.$refs.paging3.completeByKey(res.data.data.records,that.currentTabIndex);
				},err =>{
					 that.$refs.paging3.complete(false);
				})
			},
			promiseQuery(pageNum,pageSize){
				//列入严重违法失信名单（黑名单）信息
				const that = this;
				uni.$api.getRobotPromiselList({
					current: pageNum,
					size: pageSize,
					unifySocietyCc: this.companyData.creditCode
				}).then(res => {  
					//console.log("列入严重违法失信名单（黑名单）信息",res)
					that.$refs.paging4.complete(res.data.data.records);
				},err =>{
					that.$refs.paging4.complete(false);
				})
			},
			enforcementDocQuery(pageNum,pageSize){
				//获取执法文书列表数据
				const that = this;
				uni.$api.getRobotEnforcementDocList({
					current: pageNum,
					size: pageSize,
					dangshiren: this.companyData.companyName
				}).then(res => {  
					//console.log("获取执法文书列表数据",res)
					that.$refs.paging6.complete(res.data.data.records);
				},err =>{
					 that.$refs.paging6.complete(false);
				})
			},
			spotCheckNoQuery(pageNum,pageSize){
				//抽检不合格
				const that = this;
				uni.$api.getRobotSpotCheckNList({
					current: pageNum,
					size: pageSize,
					yyzzh: this.companyData.creditCode
				}).then(res => {  
					//console.log("抽检不合格",res)
					that.$refs.paging7.complete(res.data.data.records);
				},err =>{
					that.$refs.paging7.complete(false);
				})
			},
			spotCheckQuery(pageNum,pageSize){
				//抽检合格
				const that = this;
				uni.$api.getRobotSpotCheckList({
					current: pageNum,
					size: pageSize,
					yyzzh: this.companyData.creditCode
				}).then(res => {  
					//console.log("抽检合格",res)
					that.$refs.paging8.complete(res.data.data.records);
				},err =>{
					that.$refs.paging8.complete(false);
				})
			},
			dayCheckQuery(){
				//日常检查
				const that = this;
				uni.$api.getRobotDayCheckList({
					current: 1,
					size: 100000000,
					creditCode: this.companyData.creditCode
				}).then(res => {  
					//console.log("日常检查",res)
					let year = []
					let jgzq = {}
					res.data.data.records.forEach(item=>{
						let y = item.dailychkdate.slice(0, 4)
						if (year.indexOf(y) < 0) {
							year.push(y)
						}
						if (jgzq[y] == undefined) {
							jgzq[y] = {}
						} 
						if (!jgzq[y][item.jgzq]) {
							jgzq[y][item.jgzq] = []
						}
						jgzq[y][item.jgzq].push(item)
					}) 
					let tree = [] 
					year.reverse() 
					year.forEach(y=>{
						let j = Object.keys(jgzq[y])
						let tmp = {text: y, value: y, children: []}
						j.forEach(i=>{
							tmp.children.push({text: i, value: i})
						})
						tree.push(tmp)
					}) 
					that.dayCheckSelectTree = tree 
					that.dayCheckDataTreeList = jgzq
				},err =>{
					
				})
			},
			handleChange(value){ 
				let year = value.detail.value[0].value
				let jgzq = value.detail.value[1].value
				this.dayCheckList = this.dayCheckDataTreeList[year][jgzq]
			}
		},
		watch: {

		},
	}
</script>

<style lang="scss">
	.queryRearchList {
		background: #ffffff; 
		
		.h1 {
			display: flex;
			flex-direction: row;
			justify-content: flex-start;
			font-size: 36rpx;
			align-items: center;
			padding: 30rpx;
			font-weight: bold;
			
			.float {
				background: #ffffff;
				padding: 8rpx 15rpx;
				color: #4097FF;
				font-size: 20rpx;
				margin: 10rpx 0 0 20rpx;
				font-weight: normal;
			}
		}
		
		.h2 {
			padding: 0 30rpx;	
			margin: 0 auto 30rpx;
				
			.h2-view {
				display: flex;
			    align-items: center;
				font-size: 18rpx;
				margin: 15rpx auto 0;
				
				.h2-image {
					width: 30rpx;
					height: 30rpx;
					margin: 0 10rpx 0 0;
				}
			} 
		}
	}

	.tab-container {
		display: flex;
		flex-direction: column; 
		/* 设置容器高度，适配滚动 */
		border-top: 1rpx solid #e2e2e2;
	}

	.tab-scroll {
		flex: none;
		white-space: nowrap;
		/* 禁止换行 */
		overflow-x: scroll;
		/* 开启横向滚动 */
		margin: 30rpx 0;
	}

	.tab-items {
		display: inline-flex;
		/* 横向排列选项卡 */
		padding: 0 0 30rpx 0;
	}

	.tab-item {
		margin: 0 24rpx;
		font-size: 20rpx;
		color: #666;
		cursor: pointer;
		position: relative;
		text-align: center;
	}

	.tab-item.active {
		color: #077AFF; 
	}
	
	.tab-item.active::before {
		display: block; 
		width: 710rpx;
		height: 6rpx;
		background: #077AFF;
		position: absolute;
		bottom: -10rpx;
	}

	.content { 
		padding: 0rpx 20rpx;
		font-size: 20rpx; 
	}
	
	/* 企业基础信息*/
	.desc-item {
	    text-align: left;
	    display: flex;
	    align-items: center;
	    font-weight: 400;
	    color: #333333;
	    margin-bottom: 10px;
	}
	.desc-item-text {
	    font-weight: 300;
	}
	.desc-item::before {
	    display: block;
	    content: ' ';
	    width: 8px;
	    height: 8px;
	    border-radius: 4px;
	    background-color: #017aff;
	    margin-right: 10px;
	}
	
	.license-item-box{
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		align-items: flex-start;
		margin-bottom: 15rpx;
		
		.license-item{
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: center; 
			border-bottom: 1px solid #e5e5e5;
			width: 720rpx;
			padding: 20rpx 0px;
			
			.license-item-left { 
				color: #383838;
			}
			
			.license-item-right { 
				color: #818181;
			}
		}
		
	}
	/*行政处罚*/
	.punishment-item{
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		padding: 10rpx;
		border-bottom: 1px solid  #e5e5e5;
		
		
		.punishment-item-view{
			padding: 5rpx 0px;
			
			.punishment-item-title{
				font-size: 25rpx;
				color: #383838;
				font-weight: 700;
			}
			.punishment-item-text{
				font-size: 20rpx;
				color: #818181; 
			}
			
		}
		
	}
</style>